package com.ms.oschina.viewholder;

import android.text.TextUtils;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

import com.ms.oschina.R;
import com.ms.oschina.base.BaseViewHolder;
import com.ms.oschina.bean.Event;
import com.ms.oschina.util.UiUtils;
import com.ms.oschina.view.TextViewFixTouchConsume;
import com.squareup.picasso.Picasso;

public class EventViewHolder extends BaseViewHolder<Event> {
	private int mark;

	private ImageView ivEventEventImg;
	private TextView ivEventTitle;
	private TextView ivEventTime;
	private TextView ivEventLocation;
	private ImageView imageView1;

	private void findViews(View view) {
		ivEventEventImg = (ImageView) view.findViewById(R.id.iv_event_eventImg);
		ivEventTitle = (TextView) view.findViewById(R.id.iv_event_title);
		ivEventTime = (TextView) view.findViewById(R.id.iv_event_time);
		ivEventLocation = (TextView) view.findViewById(R.id.iv_event_location);
		imageView1 = (ImageView) view.findViewById(R.id.iv_shot_tweetImg);
	}

	@Override
	public View initView() {
		View view = UiUtils.inflate(R.layout.item_event);
		findViews(view);
		return view;
	}

	@Override
	public void setData(int position, Event data) {
		// switch (mark) {
		// case ActivitiesTagPage.NEW_EVENT:
		// llAboutmeMySeedInfo.setVisibility(8);
		// break;
		// case ActivitiesTagPage.MY_EVENT:
		// llAboutmeMySeedInfo.setVisibility(0);
		// break;
		// }

		String cover = data.getCover();
		if (!TextUtils.isEmpty(cover)) {
			Picasso.with(UiUtils.getContext()).load(cover)
					.placeholder(R.drawable.widget_dface).into(ivEventEventImg);
		}

		ivEventTitle.setText(data.getTitle());
		ivEventTime.setText(data.getStartTime());
		ivEventLocation.setText(data.getSpot());
		ivEventTitle.setText(data.getTitle());
	}

	public void setMark(int mark) {
		this.mark = mark;
	}

}
